﻿using System;
using System.Collections.Generic;
using System.Text;
using Moq;
using VictorBlaga.DocumentManagement.Core.Models;
using VictorBlaga.DocumentManagement.Core.Models.Repositories;
using VictorBlaga.DocumentManagement.Core.Services;
using VictorBlaga.DocumentManagement.Helpers.Mappers;
using VictorBlaga.DocumentManagement.Helpers.Validators;
using VictorBlaga.DocumentManagement.Models;
using VictorBlaga.DocumentManagement.Tests.Stubs;

namespace VictorBlaga.DocumentManagement.Tests
{
    public class AdministrationMockRepository
    {
        public User UserModel
        {
            get
            {
                var mock = new Mock<User>();
                return mock.Object;
            }
        }

        public UserViewModel UserViewModel
        {
            get
            {
                var mock = new Mock<UserViewModel>();
                return mock.Object;
            }
        }

        public TeamViewModel TeamViewModel
        {
            get
            {
                var mock = new Mock<TeamViewModel>();
                return mock.Object;
            }
        }

        public WorkshopViewModel WorkshopViewModel
        {
            get
            {
                var mock = new Mock<WorkshopViewModel>();
                return mock.Object;
            }
        }

        public IUserRepository GetUserRepository()
        {
            var mock = new Mock<IUserRepository>();
            return mock.Object;
        }

        public IWorkshopRepository GetWorkshopRepository()
        {
            var mock = new Mock<IWorkshopRepository>();
            return mock.Object;
        }

        public ITeamRepository GetTeamRepository()
        {
            var mock = new Mock<ITeamRepository>();
            return mock.Object;
        }

        public ICryptographerService GetCryptographerService()
        {
            var mock = new Mock<ICryptographerService>();
            return mock.Object;
        }

        public IUserMapper GetUserMapper()
        {
            var mock = new Mock<IUserMapper>();
            mock.Setup(m => m.MapToViewModel(null)).Returns(UserViewModel);
            return mock.Object;
        }

        public ITeamMapper GetTeamMapper()
        {
            var mock = new Mock<ITeamMapper>();
            mock.Setup(m => m.MapToViewModel(null)).Returns(TeamViewModel);
            return mock.Object;
        }

        public IUserValidator GetUserValidator(bool isValid)
        {
            var mock = new Mock<IUserValidator>();
            mock.Setup(v => v.IsInsertValid()).Returns(isValid);
            return mock.Object;
        }

        public ITeamValidator GetTeamValidator(bool isValid)
        {
            var mock = new Mock<ITeamValidator>();
            mock.Setup(v => v.IsInsertValid()).Returns(isValid);
            return mock.Object;
        }

        public IWorkshopValidator GetWorkshopValidator(bool isValid)
        {
            var mock = new Mock<IWorkshopValidator>();
            mock.Setup(v => v.IsInsertValid()).Returns(isValid);
            return mock.Object;
        }

        public IWorkshopMapper GetWokshopMapper()
        {
            var mock = new Mock<IWorkshopMapper>();
            mock.Setup(m => m.MapToViewModel(null)).Returns(WorkshopViewModel);
            return mock.Object;
        }
    }
}
